﻿package com.woniuxy.main.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016100900648589";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCdamba+JzqdTNB53698CgGc690IOPLeUf/Edy0cpalzhAWM1QF5RdfDVi/BrjT8BNVmzEi2Fv+oBQOtKj0o1XAzY7GxOjiKhKb+74e5WcTt9D/JRPIMzq8YE6RLbtMXNPayrxSMcE+wgXSWrY5fNVOK89kOHdLrOA7Q3pGwHlScY0hD1zYI4XOqdnVuTMhqbd3I4JcbC532cimPDC9iNy6Q6JlRXAdD5QUZZekXhkhvGOOQ4jE0bvJsPPljGJWzilYfqHdr4m5sBXCPzqWaSO2471py8ly0uMyea0OZnYl4uX3BnEt7MVi/r3ZJMO5uvVI2szDYv0W1OJDcG5wzpNXAgMBAAECggEAfeW+c30JCt9Hans6O7DaYiad+dPgPDk4osDnco5+/AbtiMPufHR4F7Z19vnqUt8cp4fiaYr/MItY31YQFvCXQgdlHIYZ9+BMV+KkcNNqeDO4fIdr5d9LJ6Qi0ivwM6e+bKteqKJQet/0hgO04A9+DfIuAWrDxotyHxPdtL51icAzvWFGnUHzrEsn/d3vAi+GPkS56G/avovnlpBs50ojUwP973oXc1B/DRXQ07Tfg6lMxfFI/Buh1R9yQWtceWekW4qUNhguQ09zpEuFABTanH7iDoqZRevSd6rNFbXKMZCHF/sWp//h9mLFCZGMd4WKSPDOXR4/P9F8CuTr0hlnWQKBgQDVOyGFVPqiezvKbnxfk341aE7ynDGfNbuCRV/Ck6uRkNy4uKRkk0Ffgz1KvvJMVEO+O5m88ROEWFRyzI+LzvyzToR2+kr8slWCgFWSbJFrbG+wrdW2Z3ZpzcMR94zalWQU2cxhktWLo2BGmayqK0nc99xfCB0JeKm1otS796ZmqwKBgQC8/UtlktC8OPz97Yf4BjpuhwXy27P1Njypwfi0+/4mm78476JGtkkE4re2a2Dzi6nxmgAHuom/O1FDngNH2P8JKClH30EIMEnwskaGzVfrUDRRv9TECCMjS0zOxTGDG6eKyRoqKQUdk2KR7tgvPJCRrdIR3K1wYb5veWOZjLO2BQKBgHTsrM/xLlKkor+5YCgEt+NPZGMy9R7plv2zTvRih2UV+4KrdTHVcbaPP6/aDwF9/3u0MPRjeaFL0lr1Aw3WHcmxF4Aqda4lmDAscUAOmps+ZeyLFjKkf1E7TGlwxmMiIjQwzhr/Kmwc1XFBWWYiwKkTnVrbFxkXenAobuD3xt5rAoGBAI5q5qV9tNUSsPv+QweSUfg2wjHYhM2V+LMInI5uk4Cuv7R9STG2bmJDI6RRWPdPWVra7YjldqZoYf3tlpVPHindXPZvdEdidGXxQpqVJdsLTtIIGKM9apVPSmtLSNt/PIumrpP044j9JzvH3JwELQHLFlIllYHp9qN0u6zbzhWtAoGBAL2/ujaPASjap3hT7y4Z+ETA1VJ8f8nkFZ4w5a20+f7QnM2w1+7QuQLRgoAKYUGYCyHoavcG8A44HuIzDERSjQY+jS+GUP9zh+pu2gcEMJHmga9422IpYpOffs/G2g6h3rzdxy3BlDApYTuLkK6bO9l8L4wIdohrY7ytSwzBZtk0";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyjXpYiy9qVX1a2erXVqh8SACPTF2b2eklW7TQAkI1vjuda54SVtRqYdhQADRLXl3BdP4lFGnXPwm68LnJyi/y0oh4UsXDQoxG2hUkD20K09Hl59lsStmtNmMeNRHa9UCbCnBlAPDgkYI+VL9oQVpdKqJKUSDGN0tvs15wqG6XCH/Whwbq/4pk4vidnfjyJepc1aVDz/+K0Ir7qOtI/mbgdDYvlMGpXVfFIjZXyZ1nBT5eeSqIqW7qX0BIONNmjtGfWhn07Bbtpjd2v33qA080546NlC2zIN0IQnMX6b4reMcInMMCF/MbU3rOITjrKgXF6hXII/w5rY0D4bOy8EjgQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://25924r0p74.wicp.vip/chat/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://25924r0p74.wicp.vip/chat/return";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

